<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Road3App.Views.UserControls">

    <Style TargetType="{x:Type local:TransformControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TransformControl}">
                    <Grid RenderTransformOrigin="0.5,0.5">

                        <Grid.RenderTransform>
                            <TransformGroup>
                                <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Angle}"/>
                                <!--<TranslateTransform X="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=X}" Y="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Y}"/>-->
                            </TransformGroup>
                        </Grid.RenderTransform>

                        <ContentPresenter/>

                        <Grid x:Name="ControlGrid" Opacity="0.5" Visibility="Hidden">
                            <Ellipse x:Name="Rotate" 
                                 Fill="LightGreen" Stroke="Black" 
                                 Width="10" Height="10"
                                 HorizontalAlignment="Center" VerticalAlignment="Top"/>
                            <Ellipse x:Name="Move"
                                 Fill="Red" Stroke="Black"
                                 Width="10" Height="10"
                                 HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
                        </Grid>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="X" Value="{Binding X, Mode=TwoWay}"/>
        <Setter Property="Y" Value="{Binding Y, Mode=TwoWay}"/>
        <Setter Property="Angle" Value="{Binding Angle, Mode=TwoWay}"/>
    </Style>

</ResourceDictionary>
